package org.lanqiao.service.impl;

import org.lanqiao.dao.TypeDao;
import org.lanqiao.entity.Type;
import org.lanqiao.service.TypeService;
import org.lanqiao.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class TypeServiceImpl implements TypeService {
    @Autowired
    private TypeDao typeDao;
    @Override
    /**
     * @Author 刘金渝
     * @Description //TODO
     * @Date 2019/5/22 16:15
     * @Param []
     * @explain    查询所有的类型
     * @return org.lanqiao.util.Result
     */

    public Result selectAll() {
        try {
            List<Type> types = typeDao.selectAll();
           return Result.ok(types);
        }
        catch (Exception e){

            return Result.defeated("账户已存在");
        }

    }
}
